var __wuc=__wuc||[];(function(w){function isset(v){return(v!==''&&v!==null&&typeof v!=='undefined'&&v!=='undefined')}function testStorage(){if(navigator.userAgent.toLowerCase().indexOf('firefox')>-1){return false}try{return!!localStorage.getItem}catch(e){return false}}function load(src,callback){var s=document.createElement('script');s.type='text/javascript';s.async=true;s.src=src;s.onload=callback;var t=document.getElementsByTagName('script')[0];t.parentNode.insertBefore(s,t)}function protocol(){return(document.location.protocol=='https:'?'https':'http')}function urlencode(str){str=(str+'').toString();return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/\+/g,'%2B')}function http_build_query(formdata,numeric_prefix,arg_separator){var value,key,tmp=[];var _http_build_query_helper=function(key,val){if(val===true){val='1'}else if(val===false){val='0'}if(val!==null&&typeof(val)!=='undefined'&&typeof(val)!=='function'&&typeof(val)!=='object'){return urlencode(key)+'='+urlencode(val)}else{return''}};if(!arg_separator){arg_separator='&'}for(key in formdata){value=formdata[key];if(numeric_prefix&&!isNaN(key)){key=String(numeric_prefix)+key}var query=_http_build_query_helper(key,value);if(query!==''){tmp.push(query)}}return tmp.join(arg_separator)}function getCookie(name){var nameC=name+'=';var valcid=document.cookie.split(';');for(var i=0;i<valcid.length;i++){var c=valcid[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameC)==0)return c.substring(nameC.length,c.length)}return null}function setCookie(name,value){var date=new Date();var expdate=new Date();var domaine=document.domain;var extension=domaine.substring(domaine.lastIndexOf('.'));var chaineDomaine=new String(domaine);var nomSite=chaineDomaine.replace(extension,'');var domaineComplet=nomSite.substring(nomSite.lastIndexOf('.'))+extension;expdate.setTime(date.getTime()+(365*24*60*60*1000));document.cookie=name+'='+value+';expires='+expdate.toGMTString()+';path=/ ;domain='+domaineComplet}function getLastProgid(){if(typeof tip!=='undefined'){if(isset(tip.lastProgId)===true){return tip.lastProgId}}return 0}function CrossDomainStorage(origin,path){this.origin=origin;this.path=path;this._iframe=null;this._iframeReady=false;this._queue=[];this._requests={};this._id=0}CrossDomainStorage.prototype={constructor:CrossDomainStorage,init:function(){var that=this;if(!this._iframe){if(w.postMessage&&w.JSON&&w.localStorage){this._iframe=document.createElement('iframe');this._iframe.style.cssText='position:absolute;width:1px;height:1px;left:-9999px;';document.body.appendChild(this._iframe);if(w.addEventListener){this._iframe.addEventListener('load',function(){that._iframeLoaded()},false);w.addEventListener('message',function(event){that._handleMessage(event)},false)}else if(this._iframe.attachEvent){this._iframe.attachEvent('onload',function(){that._iframeLoaded()},false);w.attachEvent('onmessage',function(event){that._handleMessage(event)})}}}if(this._iframe){this._iframe.src=this.origin+this.path}},requestValue:function(key,callback,value){var request={key:key,value:value,id:++this._id,},data={request:request,callback:callback,};if(this._iframeReady){this._sendRequest(data)}else{this._queue.push(data)}if(!this._iframe){this.init()}},_sendRequest:function(data){this._requests[data.request.id]=data;this._iframe.contentWindow.postMessage(JSON.stringify(data.request),this.origin)},_iframeLoaded:function(){this._iframeReady=true;if(this._queue.length){for(var i=0,len=this._queue.length;i<len;i++){this._sendRequest(this._queue[i])}this._queue=[]}},_handleMessage:function(event){var regex=new RegExp('publicidees.com');if(regex.test(event.origin)){var data=JSON.parse(event.data);if(isset(this._requests[data.id])){this._requests[data.id].callback(data.key,data.value)}delete this._requests[data.id]}},};var wait={max:5,current:0,more:function(){if(wait.current<wait.max&&WUCs.length<cTOPI.pitechnos.length){setTimeout(wait.more,100)}else{go()}wait.current++},};function go(){var progIdsToLoadWithoutTrackingV2=['6282','7805','7066','7067','7864'];console.log(progIdsToLoadWithoutTrackingV2.indexOf(getLastProgid()));if(WUCs.length>0&&progIdsToLoadWithoutTrackingV2.indexOf(getLastProgid())===-1){var url=protocol()+"://tracking.publicidees.com/p/v2/sprinkle?p="+getLastProgid()+'&'+http_build_query(WUCs,'w_');load(url,function(){for(var i=0,len=__wuc.length;i<len;i++){for(var techno in cTOPI.pitechnos){switch(cTOPI.pitechnos[techno]){case'LSE':if(testStorage()!==false){remoteStorage.requestValue('set',function(){},__wuc[i].WUC)}break;case'FP':setCookie('WUF',__wuc[i].WUF);break}}if(typeof tip!=='undefined'){tip.setWutoback(__wuc[i].WUC)}}})}else{}}var WUCs=[];for(var techno in cTOPI.pitechnos){switch(cTOPI.pitechnos[techno]){case'LSE':if(testStorage()!==false){var remoteStorage=new CrossDomainStorage(protocol()+"://tracking.publicidees.com/p/v2/local",'');remoteStorage.requestValue('get',function(key,value){WUCs.push(value)})}break;case'FP':WUCs.push(getCookie('WUF'));break;case'TDP':WUCs.push('eJwdjDsOgDAMxY5EXpOmSW9DP0hsCCExFO7OZ7M92NlHy4imUGKV6_gkUZBPtjOHJHhhf7OA7Kol3|ug7IyuVUsLi1cguc_WSzRGsQqW6X|SOuL9AGeLGvs');break}}setTimeout(wait.more,50)})(window);
